import request from '@/utils/request.js'

// 定义分类相关API接口函数

// 获取所有分类(顶级和二级,对应的商品推荐)
export const findAllCategory = () => request({
  url: 'home/category/head',
  method: 'GET'
})

// 获取一级类目
export const findFirst = id => request({
  url: '/category',
  params: {
    id
  }
})

// 获取筛选条件
export const findFilter = id => request({
  url: '/category/sub/filter',
  params: {
    id
  }
})

// 获取商品列表
export const fintCategoryList = data => request({
  url: '/category/goods/temporary',
  method: 'POST',
  data
})
